import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
import store from './store'

// 全局组件
import TypeNav from '@/components/TypeNav'
Vue.component(TypeNav.name, TypeNav)
import Carousel from '@/components/Carousel'
Vue.component(Carousel.name, Carousel)
import Pagination from '@/components/Pagination'
Vue.component(Pagination.name, Pagination)

//按需引入
import { Button, Row, Col, MessageBox,Message,Input} from 'element-ui';
//element-ui大多数组件，注册为全局组件Vue.component|Vue.use
Vue.use(Button);
Vue.use(Row);
Vue.use(Col);
Vue.use(Input)
//按需引入写法不同的:MessageBox、Message、Loading、Notification
Vue.prototype.$msgbox = MessageBox;
//消息提示框
Vue.prototype.$alert = MessageBox.alert;

Vue.prototype.$message = Message;

import 'element-ui/lib/theme-chalk/index.css';


Vue.config.productionTip = false

// 引入 mockServe.js 模拟数据
import '@/mock/mockServe'

import * as api from '@/api'

new Vue({
  render: h => h(App),
  // 配置全局事件总线 $bus
  beforeCreate(){
    Vue.prototype.$bus = this
    Vue.prototype.$api = api
  },
  router,
  store
}).$mount('#app')
